﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using HYRevitCode.FormUtility;

namespace HYRevitCode.SampleAndTest.CmdControlInfoManger
{
	public partial class TestFormOne : System.Windows.Forms.Form
	{
		public TestFormOne()
		{
			this.InitializeComponent();
			this.m_thisManger = new ControlInfoManager(this, new List<KeyValuePair<Control, bool>>
			{
				new KeyValuePair<Control, bool>(this.checkBox1, false),
				new KeyValuePair<Control, bool>(this.checkBox2, false),
				new KeyValuePair<Control, bool>(this.radioButton1, false),
				new KeyValuePair<Control, bool>(this.radioButton2, false),
				new KeyValuePair<Control, bool>(this.textBox1, false)
			}, "测试1", "C:\\Hongye\\YJKArch2016\\Data");
		}

		private void TestFormOne_Load(object sender, EventArgs e)
		{
			if (this.m_thisManger != null)
			{
				this.m_thisManger.SetControlInfoToForm();
			}
		}

		private void TestFormOne_FormClosing(object sender, FormClosingEventArgs e)
		{
			if (this.m_thisManger != null)
			{
				this.m_thisManger.GetControlInfoToXml();
			}
		}

		private ControlInfoManager m_thisManger;
	}
}
